package movee.spring.app.template.domain.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.sql.Timestamp;

/**
 *
 *
 * @author movee
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class BaseOrderQuery {

    // order id，自增ID
    @ApiModelProperty(value = "order id，值为null表示创建，不为null表示更新")
    private Long id;

    // 名字
    @ApiModelProperty(value = "名字", required = true)
    @NotNull(message = "name不能为null")
    @Size(min = 1, max = 255, message = "name长度合法范围1~255")
    private String name;

    // 是否已删除，true：已删除；false：未删除
    @ApiModelProperty(value = "操作单是否已删除")
    private Boolean delete;

    // 创建人
    @ApiModelProperty(value = "创建人")
    private String creator;

    // 最后修改人
    @ApiModelProperty(value = "最后修改人")
    private String updater;

    // 创建时间
    // @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    // @JsonSerialize(using = LocalDateTimeSerializer.class)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createTime;

    // 最后更新时间
    // @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    // @JsonSerialize(using = LocalDateTimeSerializer.class)
    @ApiModelProperty(value = "最后更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp updateTime;

    // 补充说明信息, 预留字段
    @ApiModelProperty(value = "补充说明信息, 预留字段")
    private String notes;

}

